﻿using System;

namespace 顺序搜索
{
	class Program
	{
		static void Main(string[] args)
		{
			int[] a = new int[] { 3, 4, 5, 7, 1 };
			Console.WriteLine("请输入要查找的数：");
			int n = int.Parse(Console.ReadLine());
			int index = -1;
			for(int i = 0; i < a.Length; i++)
			{
				if (a[i] == n)
				{
					index = i;
					break;
				}
			}

			Console.WriteLine("你要的元素在数组第{0}个位置",index);
			Console.ReadKey();
		}
	}
}
